Skip to main content

Deploying Java RESTful Engine to Azure App Service

This article describes how to deploy a Java RESTful Engine to Azure App Service. Because Azure App Services do not use a typical Tomcat directory structure or set the CATALINA_HOME environment variable, the Java RESTful Engine WAR file must be modified before it can be deployed to Azure App Service. The steps below describe how to modify the WAR file and deploy it to Azure App Service.

Creating the Azure App Service

When Creating your Azure App Service, make sure you set the following settings:

  • Publish: Code
  • Runtime Stack: Java 17
  • Java Web Server Stack: Tomcat 10.0

Preparing the Java RESTful Engine WAR to run on Azure App Service

  1. Download the Java RESTful Engine WAR file from the our downloads page.
  2. Extract the Zip file to a folder on your computer and the nested version number file.
  3. Extract ROOT.war (war files are just zip files) to a folder on your computer called ROOT.
  4. From the ROOT folder, open WEB-INF/classes/WindwardReports.properties in a text editor.
  5. Add these two lines to what is already there:
    requests.path=/home/site/wwwroot/AppData/requests
    resource.cache=/home/site/wwwroot/AppData/cache
  6. Replace the text [[LICENSE]] with your license key.
  7. Save the file.
  8. Zip the contents of the ROOT folder (not the folder itself) into a file zip file called ROOT-changed-for-app-service.war.

Deploying the Java RESTful Engine WAR to Azure App Service

  1. Open the Azure Portal and navigate to your App Service and take note of the following information:
    • Resource Group: The resource group your App Service is in.
    • App Service Name: The name of your App Service.
    • Subscription: The subscription your App Service is in.
  2. Open PowerShell and run the following commands you will need the Azure CLI installed:
    az login
    az webapp deploy --subscription <your subscription id> --resource-group <your resource group> --name <app service name> --src-path ./ROOT-changed-for-app-service.war
    • If you encounter an error running az login, try running az login --tenant <your tenant id> instead.
  3. Wait for the deployment to complete.

Final Steps

  1. Open the Azure Portal and navigate to your App Service.
  2. Open the "Advanced Tools" blade and click "Go".
  3. Click "Bash" in the top menu.
  4. Run the following commands:
    cd /home/site/wwwroot/AppData
    mkdir requests
    mkdir cache
  5. Restart your App Service and wait 1 minute. Azure claims to restart your app immediately, but in our experience the restart is not triggered immediately.
  6. Your Java RESTful Engine is now ready to use.